angular.module('province-data',[])

.controller 'provinceDataCtrl', ($scope,$http,$state,$ionicHistory,$ionicScrollDelegate,userData,$stateParams) ->
    $scope.backState = $stateParams.origin
    console.log $scope.backState
    $http.get('/seller/',params:{action:'areadata'})
    .success (resp) ->
        if resp.status == '0'
            $scope.areaData = resp.body
            console.log $scope.areaData
            $scope.provinceData = $scope.areaData[0].province
    _.extend $scope,
        goBack: ->
            $ionicHistory.goBack()
        goCity:(item) ->
            console.log item
            $state.go 'tab.city-data-myself',{provinceData:item}
    $scope.$on '$ionicView.enter',->
